package com.yunkeji.api.help.controller;

import com.yunkeji.api.help.bo.HelpListBo;
import com.yunkeji.api.help.service.HelpService;
import com.yunkeji.api.help.vo.LimitList;
import com.yunkeji.common.core.controller.BaseController;
import com.yunkeji.common.core.domain.R;
import com.yunkeji.common.core.page.TableDataInfo;
import com.yunkeji.dao.domain.sys.SysHelp;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/** 帮助中心-安全中心 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/v1/help")
public class HelpController extends BaseController {
    private final HelpService helpService;

    /** 获取文章列表 */
    @PostMapping("/helpList")
    public TableDataInfo<SysHelp> helpList(HelpListBo bo) {
        return helpService.helpList(bo);
    }

    /** 最近封号列表与统计 */
    @PostMapping("/bannerList")
    public R<List<LimitList>> bannerList() {
        return R.ok(helpService.bannerList());
    }

    /** 最近一年封号数量 */
    @PostMapping("/bannerCount")
    public R<Long> bannerCount() {
        return R.ok(helpService.bannerCount());
    }
}
